package com.ruoyi.web.controller.app.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.*;

@Data
@Valid
@ApiModel(value = "RequestRechargeEntity")
public class RequestRechargeEntity {

    @NotNull(message = "用户ID号不能为空")
    @ApiModelProperty(value = "用户ID号", position = 1, required = true)
    private Long memberId;

    @NotBlank(message = "充值金额不能为空")
    @Pattern(regexp = "^(\\d*)(\\.\\d{1,2})?$", message = "请提交正确金额")
    @Pattern(regexp = "^([1-9]\\d*(\\.\\d*)?)|(0\\.\\d*[1-9]+\\d*)$", message = "请提交大于0的金额")
    @Pattern(regexp = "^(([0-5]\\d?\\d?|[0-9]\\d?)(\\.\\d*)?|500)$", message = "请提交500以内的金额")
    @ApiModelProperty(value = "充值金额", position = 2, required = true)
    private String money;

    @NotBlank(message = "支付类型不能为空")
    @Pattern(regexp = "^weChatPay|aliPay|weChatPayApp|weChatPayApplet$", message = "请提交指定付款方式")
    @ApiModelProperty(value = "支付类型 （微信：weChatPay，支付宝：aliPay，微信APP：weChatPayApp ，微信小程序：weChatPayApplet）", position = 4, required = true)
    private String payType;

    @Length(max = 128, message = "备注长度不能超过128个字")
    @ApiModelProperty(value = "备注", position = 3, required = false)
    private String remarks;
}
